package org.apache.http.message;

import java.io.Serializable;
import org.apache.http.NameValuePair;
import org.apache.http.a.a;
import org.apache.http.a.f;
import org.apache.http.annotation.Immutable;

@Immutable
public class h implements Serializable, Cloneable, NameValuePair {
    private final String a;
    private final String b;

    public h(String str, String str2) {
        this.a = (String) a.a((Object) str, "Name");
        this.b = str2;
    }

    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof NameValuePair)) {
            return false;
        }
        h hVar = (h) obj;
        return this.a.equals(hVar.a) && f.a(this.b, hVar.b);
    }

    public String getName() {
        return this.a;
    }

    public String getValue() {
        return this.b;
    }

    public int hashCode() {
        return f.a(f.a(17, this.a), this.b);
    }

    public String toString() {
        if (this.b == null) {
            return this.a;
        }
        StringBuilder stringBuilder = new StringBuilder((this.a.length() + 1) + this.b.length());
        stringBuilder.append(this.a);
        stringBuilder.append("=");
        stringBuilder.append(this.b);
        return stringBuilder.toString();
    }
}
